<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
    <th:block th:include="include :: header('修改配件店自有配件产品属性')" />
    <th:block th:include="include :: bootstrap-fileinput-css"/>
</head>
<body class="white-bg">
    <div class="wrapper wrapper-content animated fadeInRight ibox-content">
        <form class="form-horizontal m" id="form-storeAttributeSelf-edit" th:object="${zsyhStoreAttributeself}">
            <input name="id" th:field="*{id}" type="hidden">
            <div class="form-group">    
                <label class="col-sm-3 control-label">规格名称：</label>
                <div class="col-sm-8">
                    <p name="attributeName" style="border-width: 0px;padding:6px 4px;" class="form-control" type="text">[[*{attributeName}]]</p>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">规格图：</label>
                <div class="col-sm-8">
                    <p class="user-info-head" onclick="avatarLicense()"><img id="attributeLogo" class="img-thumbnail img-lg" th:src="*{attributeLogo}"></p>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">规格备注：</label>
                <div class="col-sm-8">
                    <p name="attributeRemarks" style="border-width: 0px;padding:6px 4px;" class="form-control">[[*{attributeRemarks}]]</p>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">销售价：</label>
                <div class="col-sm-8">
                    <p name="attributeSalePrice" style="border-width: 0px;padding:6px 4px;" class="form-control" type="text">[[*{attributeSalePrice}]]</p>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">是否上架：</label>
                <div class="col-sm-8">
                    <select id="isShow" name="isShow" class="form-control m-b"  style="border: 0;appearance:none;background: transparent;" th:with="type=${@dict.getType('zsyh_yesno')}">
                        <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:field="*{isShow}"></option>
                    </select>
                </div>
            </div>
        </form>
    </div>
    <div class="row">
        <div class="col-sm-offset-5 col-sm-10">
            <button type="button" class="btn btn-sm btn-danger" onclick="window.history.go(-1); "><i class="fa fa-reply-all"></i>返 回</button>
        </div>
    </div>
    <th:block th:include="include :: footer" />
    <th:block th:include="include :: bootstrap-fileinput-js"/>
    <script th:inline="javascript">
        var prefix = ctx + "zsyh/storeAttributeSelf";
        $("#form-storeAttributeSelf-edit").validate({
            focusCleanup: true
        });

        /*规格图片*/
        function avatarLicense() {
            var url = ctx + 'zsyh/storeAttribute/avatarAttribute?attributeLogo='+$("#attributeLogo")[0].src;
            layer.open({
                type: 2,
                area: [$(window).width()/1.5 + 'px', $(window).height() + 'px'],
                fix: false,
                //不固定
                maxmin: true,
                shade: 0.3,
                title: "查看规格图片",
                content: url,
                btnClose: 1,
                // 弹层外区域关闭
                shadeClose: true,
                yes: function(index, layero) {
                    debugger;
                    var iframeWin = layero.find('iframe')[0];
                    var imageUrl = layero.find('iframe')[0].contentWindow.$("#imageUrl").val();
                    iframeWin.contentWindow.submitHandler(index, layero);
                },
                cancel: function(index) {
                    return true;
                }
            });
        }

        $(function () {
            $('#isShow').attr("disabled",true);
        })
    </script>
</body>
</html>